<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>器材管理</title>
    <link rel="stylesheet" type="text/css"  th:href="@{/css/text/bootstrap.css}"/>

    <link rel="stylesheet" type="text/css"  th:href="@{/css/component.css}"/>

    <link rel="stylesheet" type="text/css" th:href="@{/css/admin.css}"/>

    <link rel="stylesheet" type="text/css" th:href="@{/css/font-awesome.min.css}">

    <script th:src="@{./js/JQuery2.1.4.js}"></script>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!-- 富文本编辑器 -->
    <script th:src="@{./js/wang.js}"></script>
    <style type="text/css">
        .footer{
            margin-top: 20px;
            background:#222c3a;
            bottom:0;
            width: 100%;
            height: 70px;
            text-align: center;
            color: white;
            position: fixed;
        }

        .footer .footer-top{
            margin-top: 30px;
        }

        .footer a{
            color: #f0f1f1;
            text-decoration: none;
            padding: 0 10px;
            vertical-align:middle;
        }

        .footer a:hover{
            color: red;
            text-decoration: underline;
        }

        .footer p{
            height: 15px;
            color: #888888;
            margin-top: 30px;
        }
    </style>
</head>

<body>
<div class="rbody" id="app">
    <div class="top">
        当前位置：后台<i class="fa fa-fw fa-angle-right"></i>器材管理主页面
    </div>
    <div class="main">
        <div class="tabList">
            <!--<span class="active">图片列表</span>-->
            <!--<p> &lt;!&ndash;th:if="${session.permission>0}"&ndash;&gt;
                器材管理
                <span type="span" style="float: left" ><a th:href="@{../equipment/query}">租借列表</a></span>
                <span type="span" style="float: left"><a th:href="@{../equipment/query}">订单类表</a></span>
                <span type="span" style="float: left"><a th:href="@{../equipment/query}">维修列表</a></span>
            </p >-->
            <p style="font-size:15px " th:if="${session.permission}=='2'">
            器材管理
            <button type="button" style="background: transparent; border: transparent"><a th:href="@{../equipment/order}">租借列表</a></button>
            <button type="button" style="background: transparent; border: transparent" ><a th:href="@{../equipment/allorder}">订单类表</a></button>
            <button type="button" style="background: transparent; border: transparent" ><a th:href="@{../repair/torepair}">维修列表</a></button>
            </p >
            <p  style="font-size:15px" th:if="${session.permission}=='2'">器材调整
            <button type="button" style="background: transparent; border: transparent"><a th:href="@{../equipment/toinsertEquipment}">新增器材</a></button>
            </p>
            <div class="search_form">
                <div class="search_box"> <!---->
                    <form id="equipForm" th:action="@{query}" method="post">
                    <p style="font-size:15px; margin-top: 10px">
                    器材查询-输入器材名称
                    <input type="text"  name="etypename" th:value="${etypename}" style="width: 80px">
                    器材类型
                    <input type="text"  name="etypeid" th:value="${etypeid}" style="width: 80px">
                    <button type="submit" class="custom-btn btn-2" >查询</button>
                    </p>
                    </form>
                </div>
            </div>
        </div>
        <div class="imglists">
            <table>
                <colgroup>
                    <col width="100">
                    <col width="100">
                    <col width="100">
                    <col width="100">
                    <col width="100">
                    <col width="100">
                    <col width="125">
                </colgroup>
                <tr>
                    <th>
                        器材图片
                    </th>
                    <th>
                        器材名称
                    </th>
                    <th>
                        器材编号
                    </th>
                    <th>
                        租借价格
                    </th>
                    <th>
                        器材费用
                    </th>
                    <th>
                        器材数量
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <tr th:each="equip:${page.records}">
                    <!--                            <td th:text="${equip.equipid}"></td>   style=".borders{border:1px solid #d2e1f1};float:left"-->
                    <td >
                        <img th:src="@{/static/} + ${equip.getEquipPic()}" width="100" height="100" alt="" />
                    </td>
                    <td th:text="${equip.etypename}"></td>
                    <td th:text="${equip.etypeid}"></td>
                    <td th:text="${equip.getEfee()}"></td>
                    <td th:text="${equip.getBuycost()}"></td>
                    <td th:text="${equip.getBorrowcount()}"></td>
                    <td th:if="${equip.status=='1'}"> <!--1表示未租借-->
                        <a class="btn btn-success"                                   th:href="@{/equipment/toinsertRentOrder(eId=${equip.etypeid})}" style="font-size: 13px">租借</a>
                        <a class="btn btn-warning"  th:if="${session.permission}=='2'" th:href="@{../equipment/torecovery(eId=${equip.eid})}" style="font-size: 13px">保修</a>
                        <a class="btn btn-danger"  th:if="${session.permission}=='2'"  th:href="@{/equipment/deleteEquipment(eId=${equip.eid})}" style="font-size: 13px">删除</a>
                        <a class="btn btn-info"  th:if="${session.permission}=='2'" th:href="@{/equipment/toAlter(eId=${equip.eid})}" style="font-size: 13px">更新</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<script src="./js/common.js"></script>
<div class="footer" >
    <div class="footer-top">
        <a th:href="@{/equipment/query(pageNum=1,etypename=${etypename},etypeid=${etypeid})}">首页</a>
        <a  th:if="${page.current}!=1"
            th:href="@{/equipment/query(pageNum=${page.current}-1,etypename=${etypename},etypeid=${etypeid})}">
            上一页</a>
        <a th:if="${page.current}!=${page.pages}"
           th:href="@{/equipment/query(pageNum=${page.current}+1,etypename=${etypename},etypeid=${etypeid})}">
            下一页</a>
        <a th:href="@{/equipment/query(pageNum=${page.pages},etypename=${etypename},etypeid=${etypeid})}">尾页</a>
    </div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.4/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.4/dist/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.4/assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.4/examples/offcanvas/offcanvas.js"></script>
<script type="text/javascript" th:src="@{/js/jquery/lib/jquery.js}"></script>
<script type="text/javascript" th:src="@{/js/jquery/dist/jquery.validate.js}"></script>
<script>
    $().ready(function() {
        $("#equipForm").validate({
            rules: {
                etypename: {

                    maxlength: 32
                }
            },
            messages: {
                etypename: {
                    required: "请输入正确的器材名称",
                    maxlength: "器材名称不能超过32字符"
                }
            }
        });
    });
</script>
</html>